import filecmp
import os
os.mkdir('语文')
os.chdir('语文')
data_list = ['语文', '诗词', '古文', '写作', '外国文学']
for data in data_list:
    filecmp = data + '.txt'
    file = open(filecmp, 'w')
    file.close()
path = os.getcwd()
print(os.listdir(path))
os.remove('外国文学.txt')
os.remove('外国文学')
file_name = os.listdir(path)
print(file_name)
i = 1
for name in file_name:
    if '.txt' in name:
        new_name = str(i) + name
        os.rename(name, new_name)
        i += 1
print(os.listdir)
    #曾文斌